<?php
// 我的收藏
// 

$json = array('status'=>'ok','msg'=>'ok','data'=>'');

$params = $this->params();
$sys = $this->website['class']['unity']->configura('sys');

$p = $params['p']??1;
$uid = $params['uid'];

 

$json['data'] = $this->website['class']['db']
              ->table('favorites')
              ->where('uid=?',$uid)
              ->page($p)
              ->num($sys['pagingnum'])
              ->order('id desc')
              ->paging();
$pids = [];
foreach($json['data']['data'] as $v){
  $pids[] = $v['pid'];
}

$json['data']['data'] = $this->website['class']['db']
                    ->table('product')
                    ->where('id in (?)',implode(',',$pids))
                    ->select();



$this->json_encode_encrypt($json);